Subject: Re: Stopping dos VOLUME requesters
From: [email-masked] (Michael B. Smith)
Date: 18 Mar 93 11:50:01 GMT
Newsgroups: comp.sys.amiga.programmer

In article <[email-masked]> [email-masked] writes:
> Greetings.

Salutations.

> When loading a file through the DOS library, the system will pop up an
> "Insert disk PORK in any drive" requester.
>
> Is there a way to attempt to open a file using a volume name and have it
> instantly fail if the disk is not present, rather than have the system open
> a requester? Some flag in some structure, perhaps?

        struct Process
                *me = (struct Process *) FindTask (NULL);
        APTR
                my_winptr = me->pr_WindowPtr;
        BPTR
                fh;
        int
                err;

        me->pr_WindowPtr = -1;
        fh = Open ("PORK:filename", MODE_OLDFILE);
        me->pr_WindowPtr = my_winptr;

        if (!fh) {
                err = IoErr ();
                /* Likely errors:
                **
                **      ERROR_DEVICE_NOT_MOUNTED
                **      ERROR_DIR_NOT_FOUND
                **      ERROR_OBJECT_NOT_FOUND
                */
        }

> Thanks in advance.

De nada.
--
  //   Michael B. Smith
\X/    [email-masked]  -or-  uunet.uu.net!virginia.edu!adastra!mbs